package se.stabby.undersokning.webapp;

import com.google.common.base.Preconditions;
import se.stabby.undersok.model.FrågaId;

import java.util.List;

/**
 * User: per.segersten
 * Date: 2014-06-30
 */
public class Fraga {

    private String id;
    private String fraga;
    private List<String> svarsalternativ;

    public Fraga() {
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getFraga() {
        return fraga;
    }

    public void setFraga(String fraga) {
        this.fraga = fraga;
    }

    public List<String> getSvarsalternativ() {
        return svarsalternativ;
    }

    public void setSvarsalternativ(List<String> svarsalternativ) {
        this.svarsalternativ = svarsalternativ;
    }

    static class Builder {

        private Fraga fraga = new Fraga();

        public Builder setId(long id) {
            fraga.id = Long.toString(id);
            return this;
        }

        public Builder setFraga(String f) {
            fraga.fraga = f;
            return this;
        }

        public Builder setSvarsalternativ(List<String> svarsalternativ) {
            fraga.svarsalternativ = svarsalternativ;
            return this;
        }

        public Fraga build() {
            Preconditions.checkNotNull(fraga.id);
            Preconditions.checkNotNull(fraga.fraga);
            Preconditions.checkNotNull(fraga.svarsalternativ);

            return fraga;
        }
    }
}
